<template>
	<view class="container pad-32">
		<view class="centerXY pad-32 bg-white columnY radius24">
			<view class="color-grey font-28 mar-bottom-30">可用余额</view>
			<view class="ti color-theme font-48"> <text class="font-24 mar-right-5">￥</text>{{kftInfo.maxWithdrawableBalance}}
			</view>
		</view>
		<u--form class="pad-top-30" labelPosition="left" :model="info" ref="form1" labelWidth="180rpx"
			:labelStyle="{fontSize: '28rpx'}">
			<view class="bg-white pad-left-right-24 pad-top-bottom-16 radius24">
				<u-form-item label="提现金额" prop="tel" :borderBottom="false">
					<u--input type="text" clearable placeholderClass="input-style" placeholder="请输入提现金额"
						v-model="info.amount" border="none"></u--input>
				</u-form-item>
			</view>
		</u--form>
		<u-button :customStyle="{borderRadius: '12rpx'}" class="mar-top-96 font-32 button bg-theme"
			@click="$u.debounce(submit, 500)">提现</u-button>
	</view>
</template>

<script>
	// 接口地址
	import {
		userWalletInfo,
		userApply,
	} from '@/config/api.js'
	export default {
		data() {
			return {
				info: {
					amount: ''
				},
				// 快付通金额
				kftInfo: {},
				backCard: '',
				amount: 0,
				card: '',
			}
		},
		onLoad(options) {
			this.getDataInfo();
		},
		methods: {
			// 钱包详情
			getDataInfo() {
				userWalletInfo({
					plat_id: 13
				}).then(res => {
					this.kftInfo = res.data.info.kft;
				})
			},
			// 关闭验证码弹窗
			hanldeClose() {
				this.isCode = false
			},

			// 提示弹窗
			hanldeLogin() {

			},
			submit() {
				if (this.info.amount == '') {
					uni.showToast({
						title: '请输入你要提现的金额',
						icon: 'none'
					})
					return
				}

				userApply({
					pay_plat_id: 13,
					amount: this.info.amount
				}).then(res => {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					
					setTimeout(()=>{
						uni.navigateBack();
					},1000)
				})
			}
		}
	}
</script>

<style>
	.button {
		box-shadow: 0 10px 15px rgba(223, 0, 7, .1);
		height: 96rpx;
		color: white;
	}

	.input-style {
		color: rgb(192, 196, 204) !important;
	}


	.container {
		box-sizing: border-box;
		background: url('../../static/image/my-bg.png') no-repeat;
		background-size: 100% 100%;
		height: 100vh;
	}
</style>